// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
  env: 'caicren1-9ga67iu1c258fa35',
  traceUser: true
})
const db = cloud.database();
const _ = db.command;

// 云函数入口函数
exports.main = async (event1, context) => {
  let title = event1.title;
  let event = event1.event;
  let comment = event1.comment;
  let watch = event1.watch;
  let fengmian = event1.fengmian;
  let content1 = event1.conten1;
  let content2 = event1.conten2;

  return await db.collection("eventNews").add({
    data: {
      title,
      event,
      fengmian,
      comment,
      watch,
      content1,
      content2,
    }
  })

}